Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@thi.ng/adapt-dpi
Advanced tools
[!NOTE] This is one of 193 standalone projects, maintained as part of the @thi.ng/umbrella monorepo and anti-framework.
🚀 Please help me to work full-time on these projects by sponsoring me on GitHub. Thank you! ❤️
[!IMPORTANT] This package has been deprecated and merged into @thi.ng/canvas.
HDPI canvas adapter / styling utility.
Attempts to determine display pixel density via window.devicePixelRatio
(default 1.0) and resizes canvas accordingly. I.e. If DPR != 1.0, attaches
explicit width
and height
CSS properties to force canvas to given CSS pixel
size, and resizes canvas pixel buffer itself based on DPR (e.g. 2x size).
DEPRECATED - superseded by other package(s)
Search or submit any issues for this package
yarn add @thi.ng/adapt-dpi
ESM import:
import * as ad from "@thi.ng/adapt-dpi";
Browser ESM import:
<script type="module" src="https://esm.run/@thi.ng/adapt-dpi"></script>
Package sizes (brotli'd, pre-treeshake): ESM: 135 bytes
None
import { adaptDPI, isHighDPI } from "@thi.ng/adapt-dpi";
const canvas = document.createElement("canvas");
adaptDPI(canvas, 640, 480);
if (isHighDPI()) {
// ...
}
If this project contributes to an academic publication, please cite it as:
@misc{thing-adapt-dpi,
title = "@thi.ng/adapt-dpi",
author = "Karsten Schmidt",
note = "https://thi.ng/adapt-dpi",
year = 2015
}
© 2015 - 2024 Karsten Schmidt // Apache License 2.0
FAQs
HDPI canvas adapter / styling utility
We found that @thi.ng/adapt-dpi demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.